﻿@model BrnMall.Web.StoreAdmin.Models.TimeProductListModel

@section header{
<title>定时商品-商品管理</title>
<link type="text/css" rel="stylesheet" href="/admin_store/css/site.css"/>
<script type="text/javascript" src="/admin_store/scripts/jquery.js"></script>
<script type="text/javascript" src="/admin_store/scripts/showlist.js"></script>
}

@section body{
<h1 class="rightH1">
    微信小程序 &gt; 商品管理 &gt; <span class="rightH1-cur">定时商品</span>
<div class="right">
    <a href="@Url.Action("addtimeproduct")" class="menuBT"><img src="/admin_store/images/add.jpg"/>添加</a>
    <a href="@Url.Action("EditTimeProductSetting")" class="menuBT"><img src="/admin_store/images/add.jpg" />小程序设置</a>
<div class="clear"></div>
</div>
<div class="clear"></div>
</h1>
@using (Html.BeginForm("timeproductlist", "product"))
{
<div class="dataListSearch">
   <table height="32">
     <tbody>
      <tr>
        <td style="width:27%">商品名称：@Html.TextBox("ProductName", Model.ProductName, new { height = "18" })</td>
        <td><input id="searchTimeProduct" name="searchTimeProduct" type="image" class="searchBut submit" style="float:left" src="/admin_store/images/s.jpg" /></td>
      </tr>
     </tbody>
   </table>
</div>

<div class="dataList">
<table width="100%">
<thead>
  <tr>
    <th width="60" align="left">编号</th>
    <th align="left">名称</th>
    <th width="160" align="left">上架时间</th>  
    <th width="90" align="left">上架状态</th>
    <th width="160" align="left">下架时间</th>  
    <th width="90" align="left">下架状态</th>
    <th width="90" align="left">管理操作</th>
  </tr>
</thead>
  <tbody>
  @{
    string noTime = new DateTime(1900, 1, 1).ToString();
    foreach (DataRow row in Model.TimeProductList.Rows)
    {
  <tr>
    <td>@row["pid"]</td>
    <td>@row["pname"]</td>
      <td>
          @if(row["onsaletime"].ToString() != noTime)
          {
              @row["onsaletime"]
          }
      </td>
      <td>
          @if (row["onsalestate"].ToString() == "0")
          {
              @:无需上架
          }else if (row["onsalestate"].ToString() == "1")
          {
              @:待上架
          }
          else
          {
              @:已上架
          }
      </td>
      <td>
          @if (row["outsaletime"].ToString() != noTime)
          {
              @row["outsaletime"]
          }
      </td>
      <td>
          @if (row["outsalestate"].ToString() == "0")
          {
              @:无需下架
          }
          else if (row["outsalestate"].ToString() == "1")
          {
              @:待下架
          }
          else
          {
              @:已下架
          }
      </td>
      <td>

          @Html.ActionLink("编辑", "edittimeproduct", new { recordId = row["recordid"] }, new { @class = "editOperate" })
          <span class="btn-line">|</span>
          @Html.ActionLink("删除", "deltimeproduct", new { recordId = row["recordid"] }, new { @class = "deleteOperate" })
      </td>
    </tr>
    }
}
</tbody>
</table>
</div>
<div class="dataListEdit">
<div class="page">
    @Html.StoreAdminPager(Model.PageModel)
</div>
</div>
}
}